<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>后台--文章管理</title>
    <link rel="stylesheet" type="text/css" href="<?php echo isset($skin)?$skin:"";?>images/style.css" />
    <base target="_self"/>

    <script src='<?php echo isset($skin)?$skin:"";?>js/jquery.min.js'></script>
    <script type="text/javascript" src="<?php echo isset($skin)?$skin:"";?>js/jquery.form.min.js"></script>
    <script type="text/javascript" src="<?php echo isset($skin)?$skin:"";?>js/dist/dialog-min.js"></script>
    <script src="<?php echo isset($skin)?$skin:"";?>js/admin.js"></script>
    <script type="text/javascript">
        <!--
        $(document).ready(function () {
            $('.new_table tbody tr:even').addClass('h'); //奇偶变色，添加样式
        });
        //-->
    </script>
    <script type="text/javascript" charset="UTF-8" src="<?php echo isset($skin)?$skin:"";?>/js/validate.js"></script>
    <script type="text/javascript" charset="UTF-8" src="<?php echo isset($skin)?$skin:"";?>js/artTemplate.js"></script>
    <script type="text/javascript" charset="UTF-8" src="<?php echo isset($skin)?$skin:"";?>js/artTemplate-plugin.js"></script>
    <script type="text/javascript" charset="UTF-8" src="<?php echo isset($skin)?$skin:"";?>js/form.js"></script>
    <script type="text/javascript" charset="UTF-8" src="<?php echo isset($skin)?$skin:"";?>js/artDialog.js"></script>
<script type="text/javascript" charset="UTF-8" src="<?php echo isset($skin)?$skin:"";?>js/iframeTools.js"></script>
<link rel="stylesheet" href="<?php echo isset($skin)?$skin:"";?>js/artdialog.css" type="text/css">
</head>
<body>
<div class="hh6"></div>
<h1><?php echo isset($title)?$title:"";?></h1>
<div class="searchbar">
  <form action="?" method="get" name="searchListForm">
    <input type="hidden" name="c" value="device">
    <input type="hidden" name="a" value="<?php echo isset($a)?$a:"";?>">
    设备名称:
    <input type="text" name="name" class="input200" value="">
    设备编号:
    <input type="text" name="device_no" class="input200" value="">
    IP:
    <input type="text" name="ip" class="input200" value="">
    责任人/领用人:
    <input type="text" name="person" class="input200" value="">
    设备存放地点:
    <select name="location" class="input200">
      <option value=""> </option>
    <?php if(is_array($list_loc))  foreach($list_loc as $v) { ?>
      <option value="<?php echo isset($v->id)?$v->id:"";?>" <?php if($v->id==$oj->company_id){?>selected<?php }?>><?php echo isset($v->name)?$v->name:"";?></option>
    <?php }?>
      </select>

    <button class="btn" type="submit" onclick="changeAction(false)"><span class="sel">筛 选</span></button>
    <!--<button class="btn" onclick="changeAction(true)"><span class="sel">导出Excel</span></button>-->
  </form>
</div>
<script src='js/admin.js' type="text/javascript"></script>
<form name="form1" action="?c=device&a=batch_del" method="post">
<table class="new_table" width="99%" border="0" align="center" cellpadding="0" cellspacing="0">
	<thead>
<tr class="n_bt"><td colspan="12" align="center">工作小助手系统</td></tr>
  <tr>
  <td height="28" align="center"  class="thbt">编号</td>
    <!--<td height="28" align="center"  class="thbt">设备类型</td>-->
    <td height="28" align="center"  class="thbt">设备名称</td>
    <td height="28" align="center"  class="thbt">品牌</td>
    <td height="28" align="center"  class="thbt">型号</td>
    <td height="28" align="center"  class="thbt">设备状态</td>
    <td height="28" align="center"  class="thbt">产权归属</td>
    <td height="28" align="center"  class="thbt">运维责任人</td>
    <td height="28" align="center"  class="thbt">领用人</td>
    <td height="28" align="center"  class="thbt">IP</td>
    <td height="28" align="center"  class="thbt">状态</td>
    <td height="28" align="center"  class="thbt">操作</td>

  </tr></thead>

  <?php if(is_array($list))  foreach($list as $v) { ?>
  <tr>
    <td width='4%'  class="hr" align="center" >
    <input name="all[]" value="<?php echo isset($v->id)?$v->id:"";?>" type="checkbox"></td>
    <!--<td  class="hr" align="center"><?php echo isset($v->type_name)?$v->type_name:"";?></td>-->
    <td  class="hr" align="center"><a href="?c=device&a=view&id=<?php echo isset($v->id)?$v->id:"";?>"><?php echo isset($v->name)?$v->name:"";?></a></td>
    <td  class="hr" align="center"><?php echo isset($v->brand_name)?$v->brand_name:"";?></td>
    <td  class="hr" align="center"><?php echo isset($v->model)?$v->model:"";?></td>
    <td  class="hr" align="center"><?php echo isset($v->status_name)?$v->status_name:"";?></td>
    <td  class="hr" align="center"><?php echo isset($v->cq_name)?$v->cq_name:"";?></td>
    <td  class="hr" align="center"><?php echo isset($v->use_user_name)?$v->use_user_name:"";?></td>
    <td  class="hr" align="center"><?php echo isset($v->person)?$v->person:"";?></td>
    <td  class="hr" align="center"><?php echo isset($v->ip)?$v->ip:"";?></td>
    <?php $data=db::get_one("select dm.id,dm.status,dm.update_time,m.name from __device_mod dm left join __master m on m.masterid=dm.uid where dm.device_id=$v->id order by dm.id desc");  ?>
    <td  class="hr" align="center"><?php if($data->id && $data->status==0){?><span class="red">(<?php echo isset($data->name)?$data->name:"";?>)更新<?php echo date('y-m-d H:i',$data->update_time);?></span><?php }?> </td>
    <td  class="hr" align="center">
      <a href="?c=device&a=view&id=<?php echo isset($v->id)?$v->id:"";?>" class="mod">修改</a>
      <a href='javascript:alert_del("?c=device&a=del&id=<?php echo isset($v->id)?$v->id:"";?>")' class="del">删除</a>
    </td>
  </tr>
  <?php }?>
</table>
<div class="pages"><?php echo isset($pagelist)?$pagelist:"";?></div>
<div class="xuanxiang">
  <input class="button" type="button" name="chkall" value="全选" onClick="CheckAll(this.form)">
  <input class="button" type="button" name="chksel" value="反选" onClick="ContraSel(this.form)">
  <input class="button" type="submit" name="batch_del" value="删除" onclick="return confirm('您确定执行该操作吗?');">
</div>
<input type="hidden" name="c" value="device" >
<input type="hidden" name="a" value="batch_pl" >
<input type="hidden" name="page" value="<?php echo isset($page)?$page:"";?>">
  </form>
<script type="text/javascript">
    <!--
    $(document).ready(function () {
        $('.new_table tbody tr:even').addClass('h'); //奇偶变色，添加样式
    });

    //-->
    function alert_del(url) {
        if (confirm("您确定要删除吗？"))
            window.location = url;
        return false;
    }
</script>
</body>
</html>